<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<link rel="stylesheet" href="/js/plugin/layui-v2.3.0/layui/css/layui.css">
	<link rel="stylesheet" href="/css/reset.css">
	<link rel="stylesheet" href="/css/index.css">
	<link rel="stylesheet" href="/css/project_set.css">
	<script src="/js/jquery-2.1.1.min.js"></script>
	<script src="/js/plugin/layui-v2.3.0/layui/layui.js"></script>
	<script src="/js/common.js"></script>
	<style>
		 ::-webkit-scrollbar-thumb {
		  background:#a2a2a2; 
		  border-radius: 10px;
		  height:50%;
		
		::-webkit-scrollbar{width:6px;}
			body{
				overflow-y: scroll;
			} 
	</style>
<script>
	$(document).ready(function() {
	
	});
	
</script>
<style>
.layui-form-label{
	text-align:left
}
.kb-form-container{
	padding-left:20px;
}
.layui-form-item .layui-inline{
	margin-right:0px
}
</style>
</head>
<body style="overflow-y:scroll">
<div class="addemployee-wrap" id="employee-wrap">
	<div class="kb-form-container" >
		<form class="layui-form" id="defaultForm" th:action="@{/app/projectDoor/update}" th:method="post" lay-filter="employee-form">
			<input type="hidden" name="id" id="id" class="layui-input" style="border:0px" th:value="${record.id}">
			<fieldset class="fieldset">
				<div class="layui-form-item">
				    <label class="layui-form-label">名称</label>
				    <div class="layui-input-block">
				      	<input type="text" name="name" id="name"th:value="${record.name}" required  lay-verify="name" placeholder="" autocomplete="off" class="layui-input">
				    </div>
				</div>
				<div class="layui-form-item">
				    <label class="layui-form-label">门禁ID</label>
				    <div class="layui-input-block">
				      	<input type="text" name="deviceId" id="deviceId" th:value="${record.deviceId}"required  lay-verify="deviceId" placeholder="" autocomplete="off" class="layui-input">
				    </div>
				</div>
				<div class="layui-form-item">
				    <label class="layui-form-label">厂家型号</label>
				    <div class="layui-input-block">
				      	<input type="text" name="factoryVersion" id="factoryVersion" th:value="${record.factoryVersion}"  lay-verify="name" placeholder="" autocomplete="off" class="layui-input">
				    </div>
				</div>
				<div class="layui-form-item">
				    <label class="layui-form-label">设备号</label>
				    <div class="layui-input-block">
				      	<input type="text" name="serial" id="serial"  lay-verify="serial" th:value="${record.serial}" placeholder="" autocomplete="off" class="layui-input">
				    </div>
				</div>
				<div class="layui-form-item">
				    <div class="layui-inline">
					    <label class="layui-form-label">是否启用</label>
				        <div class="layui-input-inline" style="width: 200px;" th:if="${record.isEnabled} == 'true'">
				            <input name="isEnabled" title="有" type="radio" value="true"  checked="checked"/>
			     	 		<input name="isEnabled" title="无" type="radio" value="false"/>
				        </div>
				        <div class="layui-input-inline" style="width: 200px;" th:if="${record.isEnabled} == 'false'">
				            <input name="isEnabled" title="有" type="radio" value="true" />
			     	 		<input name="isEnabled" title="无" type="radio" value="false"  checked="checked"/>
				        </div>
				    </div>
				    <div class="layui-inline">
					    <label class="layui-form-label">自动开门</label>
				        <div class="layui-input-inline" style="width: 200px;" th:if="${record.isAutoEnabled} == 'false'">
				            <input name="isAutoEnabled" title="有" type="radio" value="true" />
			     	 		<input name="isAutoEnabled" title="无" type="radio" value="false" checked="checked"/>
				        </div>
				        <div class="layui-input-inline" style="width: 200px;" th:if="${record.isAutoEnabled} == 'true'">
				            <input name="isAutoEnabled" title="有" type="radio" value="true"  checked="checked"/>
			     	 		<input name="isAutoEnabled" title="无" type="radio" value="false"/>
				        </div>
				    </div>
				</div>
				<div class="layui-form-item">
				    <label class="layui-form-label">所在区域</label>
				    <div class="layui-input-block">
				    	<span th:if="${record.areaId} == 'door' ">大门</span>
				    	<span th:if="${record.areaId} != 'door' " th:text="${record.name}"></span>
				    </div>
				</div>
				<div class="layui-form-item">
				    <label class="layui-form-label">备注</label>
				    <div class="layui-input-block">
				    	<textarea id="notes"name="notes" placeholder="请输入内容" class="layui-textarea" th:text="${record.notes}"></textarea>
				    </div>
				</div>
			</fieldset>
			<fieldset class="fieldset">	
				<div class="layui-form-item" style="">
				    <div class="layui-input-block">
				      <button class="layui-btn layui-btn-normal btn-bg" lay-submit lay-filter="formDoor" id="submit-btn">提交</button>
				      <a class="layui-btn layui-btn-primary" onclick="closeLayer()">取消</a>
				    </div>
				</div>
			</fieldset>
		</form>	
	</div>
</div>
</body>
<script>
$(function(){
	layui.config({
	        base: '/js/plugin/layui-v2.3.0/layui/' //此处路径请自行处理, 可以使用绝对路径
	    }).extend({
	        formSelects: 'formSelects-v3'
	    }).use(['element',"layer","form",'formSelects'], function(){
			var layer=layui.layer,form = layui.form,formSelects = layui.formSelects;
			
			//监听提交
			  form.on('submit(formDoor)', function(data){
				  $.post($("#defaultForm").attr('action'), data.field, function(result) {
						window.parent.layer.msg(result.msg);
						closeLayer();
					}, 'json');
					return false;
			  });
			
		});
})
</script>
</html>